package com.wobito.pojo.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 
 * </p>
 *
 * @author lambyang
 * @since 2024-08-29
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("t_borrow")
@AllArgsConstructor
@NoArgsConstructor
public class Borrow implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 用户id
     */
    private Long personId;

    /**
     * 书籍id
     */
    private Long bookId;

    /**
     * 状态(0.已借阅 1.已逾期 2.已续借)
     */
    private Integer status;

    /**
     * 借阅时间
     */
    private Date startTime;

    /**
     * 应归还时间
     */
    private Date dueTime;

    /**
     * 续借天数
     */
    private Integer renewDay;

    /**
     * 续借到期时间
     */
    private Date renewTime;

    public Borrow(Long personId, Long bookId, Integer status) {
        this.personId = personId;
        this.bookId = bookId;
        this.status = status;
    }
}
